var ajax = require('../../helper/ajax')
var globalConfig = require('../config')
module.exports = {
  getUserIdBytoken: function (datas, req) {
    // return request.post(globalConfig.userService.url + '/loginFacade/getUserInfoByToken').send({token: token})
    return ajax.post(globalConfig.userService.url + '/loginFacade/getUserInfoByToken', datas, req)
  },

  getUserIdAndBindOpenid: function (datas, req) {
    // return request.post(globalConfig.userServiceDev.url + '/weChatFacade/bindOpenIdAndUserId').send(datas)
    return ajax.post(globalConfig.userService.url + '/weChatFacade/bindOpenIdAndUserId', datas, req)
  },

  getUserIdByOpenId: function (datas, req) {
    // return request.post(globalConfig.userServiceDev.url + '/weChatFacade/getUserIdByOpenId').send(datas)
    return ajax.post(globalConfig.userService.url + '/weChatFacade/getUserIdByOpenId', datas, req)
  },

  getPersonalRealName: function (datas, req) {
    // return request.post(globalConfig.userService.url + '/userFacade/getPersonalRealName').send(datas)
    return ajax.post(globalConfig.userService.url + '/userFacade/getPersonalRealName', datas, req)
  },

  getUserInvestInfo: function (datas, req) {
    // return request.post(globalConfig.userService.url + '/userFacade/getUserProperty').send(datas)
    return ajax.post(globalConfig.userService.url + '/userFacade/getUserProperty', datas, req)
  },

  unbindOpenIdAndUserId: function (datas, req) {
    return ajax.post(globalConfig.userService.url + '/weChatFacade/unbindOpenIdAndUserId', datas, req)
  },

  logout: function (datas, req) {
    return ajax.post(globalConfig.userService.url + '/loginFacade/logout', datas, req)
  }
}
